//
//  UserAccountViewModel.h
//  OCMicroBlog
//
//  Created by 002 on 15/11/5.
//  Copyright © 2015年 002. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UserAccount.h"

typedef void(^finishedCallBack) (BOOL isSuccessed);

@interface UserAccountViewModel : NSObject

// 用户信息模型
@property(nonatomic,strong) UserAccount *userAccount;

// 归档保存路径
@property (nonatomic, copy) NSString *accountPath;

// 是否过期
@property(nonatomic,assign) BOOL isExpired;

// 用户是否登录
@property(nonatomic,assign) BOOL userLogin;

// token 字典
@property(nonatomic,strong) NSMutableDictionary *tokenDict;

// 头像URL
@property (nonatomic, strong) NSURL *avatarUrl;

// -------------------------------------- 接口 -------------------------------------------

// 单例接口
+ (instancetype)sharedAccountViewModel;

// 构造函数
+ (instancetype)init;

// 加载 access_token
- (void)loadAccessTokenWithCode:(NSString *)code finished:(finishedCallBack)finished;

// 加载用户信息
- (void)loadUserInfo:(UserAccount *)userAccount finished:(finishedCallBack)finished;

@end
